home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
v9n20.arc
/
WIN_UD.XWS
< prev
next >
Wrap
Text File
|
1990-10-29
|
5KB
|
184 lines
/*
WIN_UD.XWS
PC MagNet Utilities Database download script.
Written for and with Crosstalk for Windows v1.1
by Rick Ayre. 8.24.90.
*/
-- intialize variables, and make them EMPTY
STRING FILE$, FILE1, FILE2, FILE3, FILE4, FILE5
FILE1 = "EMPTY"
FILE2 = "EMPTY"
FILE3 = "EMPTY"
FILE4 = "EMPTY"
FILE5 = "EMPTY"
-- dialogbox to get file names from user
LABEL Get_File_Name
DIALOGBOX 61,20,196,58
LTEXT 40,4,120,8, 'PC MagNet Utilities Database'
LTEXT 65,12,70,8, 'Down Load Script'
LTEXT 22,24,70,8, 'Enter File Name:'
EDITTEXT 90,24,75,12,"",FILE$, TABSTOP FOCUS
DEFPUSHBUTTON 50,40,36,14,"Ok", OK TABSTOP
PUSHBUTTON 100,40,36,14,"Cancel", CANCEL TABSTOP
ENDDIALOG
-- put file names in variables
IF CHOICE = 2 THEN ...
GOTO On_Line
IF NULL(FILE$) THEN ...
GOTO Done_Yet
IF EXISTS(FILE$) THEN ...
GOTO Get_Another
FILE5 = FILE4
FILE4 = FILE3
FILE3 = FILE2
FILE2 = FILE1
FILE1 = FILE$
IF FILE5 = "EMPTY" THEN ...
GOTO Any_More
ELSE GOTO On_Line
-- if there are still EMPTY variables
-- ask if user wants to name more files
LABEL Any_More
RB1 = 0
RB2 = 1
DIALOGBOX 81,20,136,75
LTEXT 33,14,80,10, 'Down Load Another'
RADIOBUTTON 48,22,24,12, "Yes", RB1, TABSTOP GROUP
RADIOBUTTON 48,34,24,12, "No", RB2, FOCUS
PUSHBUTTON 43,50,34,12, "Ok", OK TABSTOP
ENDDIALOG
IF CHOICE = 2 OR RB2 THEN ...
GOTO On_Line
ELSE IF RB1 THEN ...
GOTO Get_File_Name
-- if user names no files
-- ask if done
LABEL Done_Yet
RB1 = 0
RB2 = 1
DIALOGBOX 81,20,136,75
LTEXT 33,14,80,10, 'Are You Done?'
RADIOBUTTON 48,22,24,12, "Yes", RB1, TABSTOP GROUP
RADIOBUTTON 48,34,24,12, "No", RB2, FOCUS
PUSHBUTTON 43,50,34,12, "Ok", OK TABSTOP
ENDDIALOG
IF CHOICE = 2 THEN ...
GOTO On_Line
ELSE IF RB1 THEN ...
GOTO Get_Off_And_Out
ELSE IF RB2 THEN ...
GOTO Get_File_Name
-- if file already exists in download directory
-- ask if user wants a different file
LABEL Get_Another
RB1 = 0
RB2 = 1
DIALOGBOX 81,20,136,75
LTEXT 33,5,80,10, 'File Already Exists'
LTEXT 33,14,80,10, 'Care to try another?'
RADIOBUTTON 48,22,24,12, "Yes", RB1, TABSTOP GROUP
RADIOBUTTON 48,34,24,12, "No", RB2, FOCUS
PUSHBUTTON 43,50,34,12, "Ok", OK TABSTOP
ENDDIALOG
IF CHOICE = 2 OR RB2 THEN ...
GOTO On_Line
ELSE IF RB1 THEN ...
GOTO Get_File_Name
-- if there are files to download
-- load phone book entry and dial
LABEL On_Line
IF FILE1 = "EMPTY" OR NULL(FILE1) THEN ...
END
ELSE CALL "PCMAGNET"
-- send ^C to wake up PC MagNet (compuserve)
WAIT 3 SECONDS
REPLY CHR(3);
-- wait for ^C echo; resend if we don't get it back
WAIT 7 SECONDS FOR '`^C'
IF TIMEOUT THEN ...
REPLY CHR(3);
-- send UserID & Password:
-- these must already be entered in
-- phone book entry
LABEL Log_In
WAIT CASE 'ID:': REPLY UserID
WAIT CASE 'Password' : REPLY Password
WAIT "New"
-- navigate the PC MagNet Utilities Database
LABEL Get_File
REPLY "Go pcm:utilit"
WAIT FOR "Search" : REPLY "4"
WAIT FOR "(example, DR.COM):" : REPLY FILE1
-- if file cannot be found
-- jump to routine to ask user what to do next
WATCH FOR
"ad this file? (Y/N)" : REPLY "y"
"!" : GOTO No_File
ENDWATCH
WAIT FOR "transfer!" : REPLY
WAIT FOR "!" : REPLY "5"
WAIT QUIET 5 SECONDS
-- as long as there are file names
-- pass them to Get_File for download
LABEL File_To_Get
FILE1 = FILE2
FILE2 = FILE3
FILE3 = FILE4
FILE4 = FILE5
FILE5 = "EMPTY"
IF FILE1 = "EMPTY" THEN ...
GOTO Get_Off_And_Out
ELSE GOTO Get_File
-- logoff PC MagNet, drop carrier, and end script
LABEL Get_Off_And_Out
IF CONNECTED THEN
{
REPLY "Off" : OFF : BYE
CLEAR
PRINT "Thank you for using PC MagNet."
ALARM
END
}
ELSE ALARM
END
-- ask user what to do if the file
-- cannot be found
LABEL No_File
RB1 = 0
RB2 = 1
DIALOGBOX 81,20,136,75
LTEXT 33,5,80,10, 'File not found'
LTEXT 33,14,80,10, 'Continue with others?'
RADIOBUTTON 48,22,24,12, "No", RB1, TABSTOP GROUP
RADIOBUTTON 48,34,24,12, "Yes", RB2, FOCUS
PUSHBUTTON 43,50,34,12, "Ok", OK TABSTOP
ENDDIALOG
IF CHOICE = 2 OR RB1 THEN ...
GOTO Get_Off_And_Out
ELSE IF RB2 THEN GOTO File_To_Get